package com.eastjet.maintenance.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 调拨设备明细
 *
 * @TableName allocation_details
 */
@TableName(value = "allocation_details")
@Data
public class AllocationDetails implements Serializable {
    /**
     * 调布设备明细主键id
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 关联调拨编码
     */
    private String code;

    /**
     * 设备编号
     */
    private String deviceNumber;

    /**
     * 设备名称
     */
    private String name;

    /**
     * 规格型号
     */
    private String specification;

    /**
     * 设备类型
     */
    private String deviceType;

    /**
     * 品牌
     */
    private String brand;

    /**
     * 调出部门
     */
    private String pull;

    /**
     * 原负责人
     */
    private String originallyResponsible;

    /**
     * 存放位置
     */
    private String storageLocation;

    /**
     * 调入部门
     */
    private String dispatchDepartment;

    /**
     * 新负责人
     */
    private String newResponsible;

    /**
     * 调入位置
     */
    private String tuneLocation;

    /**
     * 备注
     */
    private String remark;

    /**
     * 创建人
     */
    private String createdBy;

    /**
     * 创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date creationTime;

    /**
     * 更新人
     */
    private String updater;

    /**
     * 更新时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date updated;

    /**
     * 逻辑删除
     */
    private Integer tombstone;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        AllocationDetails other = (AllocationDetails) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
                && (this.getCode() == null ? other.getCode() == null : this.getCode().equals(other.getCode()))
                && (this.getDeviceNumber() == null ? other.getDeviceNumber() == null : this.getDeviceNumber().equals(other.getDeviceNumber()))
                && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
                && (this.getSpecification() == null ? other.getSpecification() == null : this.getSpecification().equals(other.getSpecification()))
                && (this.getDeviceType() == null ? other.getDeviceType() == null : this.getDeviceType().equals(other.getDeviceType()))
                && (this.getBrand() == null ? other.getBrand() == null : this.getBrand().equals(other.getBrand()))
                && (this.getPull() == null ? other.getPull() == null : this.getPull().equals(other.getPull()))
                && (this.getOriginallyResponsible() == null ? other.getOriginallyResponsible() == null : this.getOriginallyResponsible().equals(other.getOriginallyResponsible()))
                && (this.getStorageLocation() == null ? other.getStorageLocation() == null : this.getStorageLocation().equals(other.getStorageLocation()))
                && (this.getDispatchDepartment() == null ? other.getDispatchDepartment() == null : this.getDispatchDepartment().equals(other.getDispatchDepartment()))
                && (this.getNewResponsible() == null ? other.getNewResponsible() == null : this.getNewResponsible().equals(other.getNewResponsible()))
                && (this.getTuneLocation() == null ? other.getTuneLocation() == null : this.getTuneLocation().equals(other.getTuneLocation()))
                && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
                && (this.getCreatedBy() == null ? other.getCreatedBy() == null : this.getCreatedBy().equals(other.getCreatedBy()))
                && (this.getCreationTime() == null ? other.getCreationTime() == null : this.getCreationTime().equals(other.getCreationTime()))
                && (this.getUpdater() == null ? other.getUpdater() == null : this.getUpdater().equals(other.getUpdater()))
                && (this.getUpdated() == null ? other.getUpdated() == null : this.getUpdated().equals(other.getUpdated()))
                && (this.getTombstone() == null ? other.getTombstone() == null : this.getTombstone().equals(other.getTombstone()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getCode() == null) ? 0 : getCode().hashCode());
        result = prime * result + ((getDeviceNumber() == null) ? 0 : getDeviceNumber().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getSpecification() == null) ? 0 : getSpecification().hashCode());
        result = prime * result + ((getDeviceType() == null) ? 0 : getDeviceType().hashCode());
        result = prime * result + ((getBrand() == null) ? 0 : getBrand().hashCode());
        result = prime * result + ((getPull() == null) ? 0 : getPull().hashCode());
        result = prime * result + ((getOriginallyResponsible() == null) ? 0 : getOriginallyResponsible().hashCode());
        result = prime * result + ((getStorageLocation() == null) ? 0 : getStorageLocation().hashCode());
        result = prime * result + ((getDispatchDepartment() == null) ? 0 : getDispatchDepartment().hashCode());
        result = prime * result + ((getNewResponsible() == null) ? 0 : getNewResponsible().hashCode());
        result = prime * result + ((getTuneLocation() == null) ? 0 : getTuneLocation().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        result = prime * result + ((getCreatedBy() == null) ? 0 : getCreatedBy().hashCode());
        result = prime * result + ((getCreationTime() == null) ? 0 : getCreationTime().hashCode());
        result = prime * result + ((getUpdater() == null) ? 0 : getUpdater().hashCode());
        result = prime * result + ((getUpdated() == null) ? 0 : getUpdated().hashCode());
        result = prime * result + ((getTombstone() == null) ? 0 : getTombstone().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", code=").append(code);
        sb.append(", deviceNumber=").append(deviceNumber);
        sb.append(", name=").append(name);
        sb.append(", specification=").append(specification);
        sb.append(", deviceType=").append(deviceType);
        sb.append(", brand=").append(brand);
        sb.append(", pull=").append(pull);
        sb.append(", originallyResponsible=").append(originallyResponsible);
        sb.append(", storageLocation=").append(storageLocation);
        sb.append(", dispatchDepartment=").append(dispatchDepartment);
        sb.append(", newResponsible=").append(newResponsible);
        sb.append(", tuneLocation=").append(tuneLocation);
        sb.append(", remark=").append(remark);
        sb.append(", createdBy=").append(createdBy);
        sb.append(", creationTime=").append(creationTime);
        sb.append(", updater=").append(updater);
        sb.append(", updated=").append(updated);
        sb.append(", tombstone=").append(tombstone);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}